def apply_script(protocol, connection, config):
    class IntelBuildConnection(connection):
        def on_block_build_attempt(self, x, y, z):
            value = connection.on_block_build_attempt(self, x, y, z)
            if value is None:
                flag = self.team.other.flag
                if flag.player is None:
                    self.send_chat("Your team needs to have intel to build!")
                    return False
                else:
                    return value
        def capture_flag(self):
            self.send_chat("Capturing intel is disabled! Your team needs it to build!")
            return False
        def on_flag_drop(self):
            self.protocol.send_chat("%s team has forgotten how to build!" % self.team.name)
            return connection.on_flag_drop(self)
        def on_flag_take(self):
            self.protocol.send_chat("%s team has remembered how to build!" % self.team.name)
            return connection.on_flag_take(self)
    return protocol, IntelBuildConnection